package com.xxl.job.executor.service;

import com.xxl.job.executor.model.GatherDefModel;
import com.xxl.job.executor.model.GatherMjModel;
import com.xxl.job.executor.repository.GatherDefRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 查询采集口配置
 */
@Service
public class GatherDefService {

    @Autowired
    private GatherDefRepository gatherDefRepository;

    /**
     * 获取采集口配置信息 单个
     * @param gatherId
     * @return
     */
    public GatherDefModel getGatherDefModel(String gatherId){
        return gatherDefRepository.findGatherDefModel(gatherId);
    }

    /**
     * 获取采集口配置信息 多个
     * @param gatherId
     * @return
     */
    public List<GatherDefModel> findGatherDefModelList(String gatherId){
        return gatherDefRepository.findGatherDefModelList(gatherId);
    }


    /**
     * 查询所有IP不为空的启用采集口
     * @return
     */
    public List<GatherDefModel> findGatherDefModelAll(){
        return gatherDefRepository.findGatherDefModelAll();
    }


    /**
     * 获取门禁配置信息 多个
     * @param gatherId
     * @return
     */
    public List<GatherMjModel> findGatherMjModelList(String gatherId){
        return gatherDefRepository.findGatherMjModelList(gatherId);
    }

}
